<template>
  <div>
    <!-- 记录 筛选 头部 -->
    <div class="call-back-panel">
      <div class="call-back-btn" @click="$router.push('/record')"><img src="~images/common/return.png" alt=""></div>
      <div class="title">筛选结果</div>
      <div class="screen-result-total">
        <span>共</span>
        <span>{{resultTotal}}</span>
        <span>条记录符合条件</span>
      </div>
      <div class="screen-btn">
        <span><img src="~images/default/funnel.png" alt=""></span>
        <span @click="$router.push('/recordSearchForm')">修改筛选条件</span>
      </div>
    </div>
    <!-- 记录 筛选 主体 -->
    <div class="content-box">
       <van-list
          v-model="loading"
          :finished="finished"
          finished-text="没有更多了"
          @load="onLoad"
        >
          <div v-for="(item, index) in temperData" :key="index">
            <Temper
              :info="item"
            />
          </div>
       </van-list>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      queryForm: {
        year_num: '2021',
        month_num: '01',
        day_num: '06',
      },
      resultTotal: '',
      pageNumber: 0,
      loading: false,
      finished: false,
      temperData: [],
    }
  },
  created() {
    debugger
    this.$route.params
  },
  methods: {
    onLoad() {
      this.loading = true
      this.pageNumber= this.pageNumber + 1
      this.queryForm.page = this.pageNumber
      this.getTemperatureList()
    },
    getTemperatureList() {
      this.$api.panel.getTemperatureList( this.queryForm ).then(res=> {
        this.resultTotal = res.data.total
        this.temperData.push(...res.data.data)
        this.loading = false
      })
      if (this.resultTotal === this.temperData.length) this.finished = true
    },
  },
}
</script>
<style lang="scss" scoped>
.call-back-panel {
  position: relative;
  width: 100vw;
  height: 90px;
  background: url("~images/theme/header_bg.png") no-repeat;
  background-size: 100% 100%;
  .call-back-btn {
    position: absolute;
    top: 23px;
    left: 23px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 16px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .title {
    position: absolute;
    top: 22px;
    left: 156px;
    font-size: 16px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #ffffff;
  }
  .screen-result-total {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 8px;
    left: 20px;
    span {
      &:first-child,
      &:last-child {
        font-size: 12px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #ffffff;
      }
      &:nth-child(2) {
        padding: 0 4px;
        font-size: 24px;
        font-family: JCHEadA;
        color: #ffffff;
      }
    }
  }
  .screen-btn {
    display: flex;
    position: absolute;
    bottom: 14px;
    right: 20px;
    span {
      &:first-child {
        display: grid;
        place-items: center;
        width: 14px;
        height: 14px;
        margin-right: 11px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      &:last-child {
        font-size: 14px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #ffffff;
      }
    }
  }
}
.content-box {
  margin: 15px;
}
</style>